<?php
namespace cms\modules\v1\controllers;

use cms\modules\v1\models\userReceipt\ReceiptAlipay;
use cms\modules\v1\models\userReceipt\ReceiptBank;
use Yii;
use yii\filters\auth\HttpHeaderAuth;
use yii\helpers\ArrayHelper;

/**
 * 报表控制器 controller
 */
class ReceiptController extends DefaultController
{
    public $modelClass = '';

    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'authenticator' => [
                'class' =>  HttpHeaderAuth::className(),    //head头部验证
                'header' => 'access-token',
                'optional' => []
            ]
        ]);
    }

    public function actionBankList($page, $size) {
        if (Yii::$app->request->isGet) {
            return (new ReceiptBank())->getListData($page, $size);
        }
    }

    public function actionBank() {
        if (Yii::$app->request->isPost) {
            return (new ReceiptBank())->audit();
        }
    }
}
